﻿<Window x:Class="Projecturo.ProjecturoClient.View.LoginView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ext="clr-namespace:Projecturo.ProjecturoClient.Extension"
    xmlns:com="clr-namespace:Projecturo.ProjecturoClient.Command"
    Title="Projecturo Login" 
    MinWidth="300"  
    MaxWidth="400"
    SizeToContent="Height" 
    WindowStartupLocation="CenterScreen"
    Icon="../Resources/Images/ProjecturoIcon.ico"
    FocusManager.FocusedElement="{Binding ElementName=UsernameBox}">
    
    <Window.Resources>
        <com:CommandReference Command="{Binding ExitCommand}" x:Key="ExitCommand"/>
        <com:CommandReference Command="{Binding LoginCommand}" x:Key="LoginCommand"/>
    </Window.Resources>
    
    <Window.InputBindings>
        <KeyBinding Command="{StaticResource LoginCommand}" Key="Return" />
    </Window.InputBindings>
    
        <Border
            Style="{StaticResource MainBorderStyle}"
            >
        <HeaderedContentControl 
              Header="Professional Management of Issues, Features, Tasks and Projects"
              Style="{StaticResource MainHCCStyle}" HeaderTemplate="{DynamicResource HeaderTemplate_TopHeader}"
              >
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>

                <TextBlock Text="Username" Grid.Column="0" Grid.Row="1" />
                <TextBlock Text="Password" Grid.Column="0" Grid.Row="2"/>

                <TextBox x:Name="UsernameBox" Text="{Binding Username}" TabIndex="0" Grid.Column="1" Grid.Row="1"/>

                <PasswordBox ext:PasswordBoxBinding.BindPassword="true" TabIndex="1" ext:PasswordBoxBinding.BoundPassword="{Binding Path=Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Grid.Row="2"/>

                <Button Content="Cancel" Command="{Binding CancelCommand}" Grid.Column="0" Grid.Row="3" KeyboardNavigation.TabIndex="3"/>
                <Button Content="Login" Command="{Binding LoginCommand}" Grid.Column="1" Grid.Row="3" KeyboardNavigation.TabIndex="2"/>
            </Grid>
        </HeaderedContentControl>
    </Border>
        
        
</Window>
